var index = 0;
var time = 2000;
var arr = new Array();
arr[0] = "img/1.png";
arr[1] = "img/2.png";
arr[2] = "img/3.png";
arr[3] = "img/4.png";
arr[4] = "img/5.jpg";
arr[5] = "img/6.png";

setInterval(changeImg, time);
function changeImg() {
	var obj = document.getElementById("obj");
	if (index == arr.length - 1) {
		index = 0;
	} else {
		index += 1;
	}
	obj.src = arr[index];
	}